package com.exam.exception;


import com.exam.utils.ResultVOUtil;
import com.exam.vo.ResultVO;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Create by fengguofei
 * Date: 2017/9/26
 * Time: 14:29
 */
@ControllerAdvice
public class ExaminationExceptionHandler {

    @ExceptionHandler(value = ExaminationException.class)
    @ResponseBody
    public ResultVO handlerAnbixuanException(ExaminationException e) {
        return ResultVOUtil.error(e.getCode(), e.getMessage());
    }
}
